package com.googlecode.monitoring.db.model;

/**
 * Author: Sergiy Doroshenko
 * Date: Aug 11, 2010
 * Time: 1:35:04 PM
 */
public class DataSourceItem {
    private String id;
    private String beanName;
    private String name;
    private String descr;

    public DataSourceItem() {
    }

    public DataSourceItem(String id, String beanName) {
        this.id = id;
        this.beanName = beanName;
    }

    public DataSourceItem(String id, String beanName, String name, String descr) {
        this.id = id;
        this.beanName = beanName;
        this.name = name;
        this.descr = descr;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getBeanName() {
        return beanName;
    }

    public void setBeanName(String beanName) {
        this.beanName = beanName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescr() {
        return descr;
    }

    public void setDescr(String descr) {
        this.descr = descr;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        DataSourceItem that = (DataSourceItem) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return id != null ? id.hashCode() : 0;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder();
        sb.append("DataSourceItem");
        sb.append("{beanName='").append(beanName).append('\'');
        sb.append(", id='").append(id).append('\'');
        sb.append('}');
        return sb.toString();
    }
}
